package com.itheima.controller;

import com.itheima.clients.UserFeignApi;
import com.itheima.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SuppressWarnings("ALL")
@RestController
@RequestMapping("feign")
public class FeignController {

    @Autowired
    UserFeignApi userFeignApi;

    @GetMapping("{id}")
    public User findById(@PathVariable("id")String username){
        return userFeignApi.findById(username);
    }

}
